c语言高手来`!

来源:百度知道 编辑:UC知道 时间:2024/05/22 18:42:34
C语言高手来告诉我编程哦`!
(一)编写程序,输入三个整数并返回其中最大的那个。
(二)从键盘上输入一个字母,如果是小写字母就将它的大写字母输出,否则输出它的小写字母。
(三)从键盘上输入一个字符。求它的前一个字符和后一个字符,并将这三个字符及其ASCII码输出。
(四)从键盘上输入一个数字字符,将其对应的汉字输出来(如 输入1,则输出“一”)。

(一)编写程序,输入三个整数并返回其中最大的那个。
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"

void main()
{ int a,b,c,t;
scanf("%d %d %d",&a,&b,&c);
t = (a>b)? a : b;
t = (t>c)? t : c;
printf("%d",t);
}

(二)从键盘上输入一个字母,如果是小写字母就将它的大写字母输出,否则输出它的小写字母。
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"

void main()
{ char c;
c=getche();
if(c>='A' && c<='Z') printf("%c,%c",c,c+32);
else if(c>='a' && c<='z') printf("%c,%c",c,c-32);
else printf("Not a letter");
}

(三)从键盘上输入一个字符。求它的前一个字符和后一个字符,并将这三个字符及其ASCII码输出。
#include "stdio.h"
#include "conio.h"
#include "stdlib.h"

void main()
{ char c;
c=getche();
printf("The